<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <button onclick="fn()">百度</button>
  <script>
    function fn () {
      // location.replace('http://www.baidu.com')
      // location.href = 'http://www.baidu.com'
      
      window.open('http://www.baidu.com')

    }
  </script>
</body>
</html>